import axiosRequest from "@/api/axiosRequest.ts";

const BaseUrl = '/article'

const getArticlePage = (article:Partial<ArticleSearch>) => axiosRequest({
    url: BaseUrl + '/page',
    method: 'POST',
    data: article
})

const getArticleDetail = (id:number) => axiosRequest({
    url: BaseUrl + '/detail' ,
    method: "GET",
    params: {
        id: id
    }
})

export const articleApi = {
    getTopArticle : () => axiosRequest.get(BaseUrl + '/getTopArticle'),
    getArticleList : () => axiosRequest.get(BaseUrl + '/list'),
    getArticlePage,
    getArticleDetail,
}
